<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS自定义对象方式一</title>
</head>
<body>
<script>
    /*js自定义对象方式一*/
    function Person(){}

    let p = new Person();
    p.name="王云爽"
    p.age=19
    p.run = function(){
        alert(this.name+"在跑步")
    }

    console.log(p)

    p.name="张飞"
    console.log(p)
    //调用对象的方法
    p.run()
</script>
</body>
</html>